$OpenBSD: patch-plugins_node_d_openbsd_if__in,v 1.3 2012/10/12 09:46:46 kirby Exp $
--- plugins/node.d.openbsd/if_.in.orig	Fri Aug 31 19:22:50 2012
+++ plugins/node.d.openbsd/if_.in	Sun Sep 30 23:19:21 2012
@@ -4,9 +4,9 @@
 # Wildcard-plugin to monitor network interfaces. To monitor an
 # interface, link if_<interface> to this file. E.g.
 #
-#    ln -s /usr/share/munin/node/plugins-auto/if_ /etc/munin/node.d/if_eth0
+#    ln -s /usr/share/munin/node/plugins-auto/if_ /etc/munin/node.d/if_em0
 #
-# ...will monitor eth0.
+# ...will monitor em0.
 #
 # To aggregate all network interfaces on the system (except lo0), 
 # link if_aggregated to this file.
@@ -33,7 +33,7 @@ fi
 
 if [ "$1" = "suggest" ]; then
 	if [ -x /usr/bin/netstat ]; then
-		netstat -i -b -n | sed -n -e '/^faith/d' -e '/^lo[0-9]/d' -e '/^pflog/d' -e '/<Link#[0-9]*>/s/\** .*//p'
+		netstat -i -b -n | sed -n -e '/^faith/d' -e '/^lo[0-9]/d' -e '/^pflog/d' -e '/<Link>/s/\** .*//p'
 		exit 0
 	else
 		exit 1
@@ -47,7 +47,7 @@ if [ "$1" = "config" ]; then
 	echo 'graph_args --base 1000'
 	echo 'graph_vlabel bits per ${graph_period} in (-) / out (+)'
 	echo 'graph_category network'
-	echo "graph_info This graph shows the traffic of the $INTERFACE network interface. Please note that the traffic is shown in bits per second, not bytes. IMPORTANT: Since the data source for this plugin use 32bit counters, this plugin is really unreliable and unsuitable for most 100Mb (or faster) interfaces, where bursts are expected to exceed 50Mbps. This means that this plugin is unsuitable for most production environments."
+	echo "graph_info This graph shows the traffic of the $INTERFACE network interface. Please note that the traffic is shown in bits per second, not bytes."
 	echo 'rbytes.label received'
         echo 'rbytes.type DERIVE'
         echo 'rbytes.graph no'
@@ -65,11 +65,11 @@ fi
 if [ "$INTERFACE" = "aggregated" ]; then
 	/usr/bin/netstat -i -b -n | grep -v '^lo' | awk '
 BEGIN { rsum = 0; osum = 0; }
-/<Link#[0-9]*>/ {
-	if (NF == 10) { 
-		rsum += $6; osum += $9;
+/<Link>/ {
+	if (NF == 5) { 
+		rsum += $4; osum += $5;
 	} else {
-		rsum += $7; osum += $10;
+		rsum += $5; osum += $6;
 	}
 }
 END {
@@ -79,13 +79,13 @@ END {
   
 else
 	/usr/bin/netstat -i -b -n -I $INTERFACE | awk '
-/<Link#[0-9]*>/ {
-	if (NF == 10) { 
-		print "rbytes.value", $6;
-		print "obytes.value", $9;
+/<Link>/ {
+	if (NF == 5) { 
+		print "rbytes.value", $4;
+		print "obytes.value", $5;
 	} else {
-		print "rbytes.value", $7;
-		print "obytes.value", $10;
+		print "rbytes.value", $5;
+		print "obytes.value", $6;
 	}
 }'
 fi
